#ifndef THREADPOLL_H
#define THREADPOLL_H

#include <my_header.h>
#include "taskQueue.h"
#include "tidArr.h"
#include "pathStack.h"
#include "TLV.h"
#include "tcpInit.h"
#include "epoll.h"

/* #define PATH_PREFIX "~/netdisk/" */
#define PATH_PREFIX "/home/sypha/netdisk/"
#define MAX_PARTS 10
typedef struct threadPool_s{
    //线程数组
    tidArr pTidArr;
    //任务队列
    taskQueue pTaskQueue; 
    //锁
    pthread_mutex_t mutex;
    //条件变量
    pthread_cond_t cond;
    //退出标志位
    int exit_flag;
}threadPool_t;
//初始化
void threadPoolInit(threadPool_t* pThreadPool,int workerNum);
//线程入口函数
void* threadFunc(void* arg);
//创建子线程worker
void makeWorker(threadPool_t* pThreadPool,int workerNum);
//处理命令
int deal_cmd(path_stack_t* path_stack, char *parts[], int count, char* server_path, char* result, int netfd);
#endif
